//
//  FooterView4Sec0.m
//  WashForU
//
//  Created by 王俊 on 15/12/3.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "FooterView4Sec0.h"
@interface FooterView4Sec0()
@property(nonatomic,strong)UILabel      *incomeTitleLabel;
@property(nonatomic,strong)UILabel      *incomeNumberLabel;
@property(nonatomic,strong)UIImageView  *cutOffLineImage;

@end

@implementation FooterView4Sec0


- (instancetype)initWithIncome:(int) incomeNumb
{
    if (self = [super init]) {
        self.income = incomeNumb;
        [self setUpView];
        [self addCustomConstrain];

    }
    return self;
    
}

- (void)setUpView
{
    self.backgroundColor = [UIColor whiteColor];
    self.incomeTitleLabel = [[UILabel alloc]init];
    self.incomeNumberLabel = [[UILabel alloc]init];
    self.cutOffLineImage = [[UIImageView alloc]init];
    [self.incomeTitleLabel setText:@"费用总计:" andFont:[UIFont CustomFont:15] andColor:[UIColor GrayColor_30] andAligm:NSTextAlignmentRight];
    [self.incomeNumberLabel setText:[NSString stringWithFormat:@"%d元",self.income] andFont:[UIFont boldSystemFontOfSize:17] andColor:[UIColor CustomOrangeColor] andAligm:NSTextAlignmentLeft];
    self.cutOffLineImage.image = [UIImage imageNamed:@"白底黑线"];

    [self addSubview:self.incomeTitleLabel];
    [self addSubview:self.incomeNumberLabel];
    [self addSubview:self.cutOffLineImage];
    
    
}
- (void)addCustomConstrain
{
    [self.incomeTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(70, 20));
        make.trailing.equalTo(self).offset(-70);
        make.centerY.equalTo(self);
    }];
    [self.incomeNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.height.equalTo(self.incomeTitleLabel);
        make.leading.equalTo(self.incomeTitleLabel.mas_trailing);
    }];
    [self.cutOffLineImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self).offset(5);
        make.trailing.equalTo(self).offset(30);
        make.top.equalTo(self).offset(-4);
        make.height.mas_equalTo(8);
    }];
}

@end
